<template>
    <div>
        <myheader />
        {{userinfo}}
        <h1>用户中心</h1>
        用户名：{{username}}
        <br>
        手机号：{{userinfo[0].mobile}}









    </div>
</template>

<script>
import myheader from './myheader.vue'

    export default {
        components:{
        'myheader':myheader,
        
    },
    data(){
        return{
            username:'',
            mobile:'',
            username:localStorage.getItem('username'),
            userid:localStorage.getItem('userid'),
            userinfo:[]
        }
    },
    //手机号只显示三位
    filters:{
        myfilter(){
            value = value.slice(0,3)
            return value + '********'
        }
    },
    //方法
    methods: {
        getuserinfo(){
            this.$axios.get('/users/getuserinfo/?userid='+this.userid).then(res=>{
                this.userinfo=res.data.list
            })
        
        }
    },
    mounted() {
        this.getuserinfo()
    },
}
</script>

<style scoped>

</style>